﻿<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" CodeBehind="Edit.aspx.cs" Inherits="PlugNT.Cms.Web.Admin.Ad_Edit" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>管理员管理</title>
<link href="../css/control.css" rel="stylesheet" type="text/css" media="all" />
<script src="../js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
    $(function () {
        showAd();

        $("input[name=rblAdType]").click(function () {
            showAd();
        });
        $("#txtStarttime]").click(function () {
            return Calendar('txtStarttime');
        });
        $("#txtEndtime]").click(function () {
            return Calendar('txtEndtime');
        });
    });
    function showAd() {
        if ($("input[name=rblAdType]:checked").val() == "0") {
            for (var i = 1; i < 5; i++) {
                $("#ad" + i).hide();
            }
            $("#ad5").show();
        }
        else {
            for (var i = 1; i < 5; i++) {
                $("#ad" + i).show();
            }
            $("#ad5").hide();
        }
    }
</script>
</head>
<body>

<div class="frmstatic" style="display:block;">
    <span class="frmbar" style="margin:0 12px;"></span><span class="frmbar" style="margin:0 11px;"></span>
    <div class="nav_menu">
        <table cellspacing="0" cellpadding="0" border="0" width="100%">
          <tr>
            <td align="left">
                <table>
                    <tr>
                        <td><img src="../images/main_home.gif" width="16" height="16" /></td>
                        <td><label>模块&nbsp;&gt;&nbsp;广告管理&nbsp;&gt;&nbsp;修改广告</label></td>
                    </tr>
                </table>
            </td>
            <td align="right">
                <table>
                    <tr>
                        <td><img src="../images/arrow_left.png" width="16" height="16" /></td>
                        <td><label><a href="../AdClass/Admin.aspx" class="sub_menu">广告位置</a></label> | </td>
                        <td><label><a href="./Admin.aspx" class="sub_menu_selected">广告列表</a></label> | </td>
                        <td><label><a href="./Add.aspx" class="sub_menu">添加广告</a></label> | </td>
                        <td><label><a href="javascript:window.history.back();" class="sub_menu">返回</a></label></td>
                    </tr>
                </table>
            </td>
          </tr>
        </table>
    </div>
    <span class="frmbar" style="margin:0 11px;"></span><span class="frmbar" style="margin:0 12px;"></span>
</div>

<div class="frmstatic" style="display:block; margin-top:10px;">
<form id="form1" runat="server">
<span class="frmbar" style="margin:0 12px;"></span><span class="frmbar" style="margin:0 11px;"></span>
<div class="controls">
            
          <table width="100%"  border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#ecf5ff">


            <tr>
              <td width="145" align="right" nowrap bgcolor="#F4FBFF">广告名称:</td>
              <td width="1040" bgcolor="#F4FBFF">
                    <asp:TextBox ID="txtDescription" runat="server"  CssClass="input"  Width="200px"></asp:TextBox>
              </td>
            </tr>
            
            <tr>
              <td align="right" nowrap bgcolor="#F4FBFF">当前页面:</td>
              <td bgcolor="#F4FBFF"> 
                <asp:DropDownList ID="ddlMenu" runat="server"  Width="200px" ></asp:DropDownList>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                      ControlToValidate="ddlMenu" ErrorMessage="<span style='color:#ff0000;'>请填选择页面</span>" Display="Dynamic"></asp:RequiredFieldValidator>
               </td>
            </tr>

            <tr>
              <td align="right" nowrap bgcolor="#F4FBFF">广告类型:</td>
              <td bgcolor="#F4FBFF">
                 <asp:RadioButtonList ID="rblAdType" runat="server" RepeatDirection="Horizontal" 
                     RepeatLayout="Flow">
                     <asp:ListItem Selected="True" Value="2">图片 </asp:ListItem>
                     <asp:ListItem Value="1">动画 </asp:ListItem>
                     <asp:ListItem Value="0">代码 </asp:ListItem>
                 </asp:RadioButtonList>
               </td>
            </tr>

            <tr id="ad1">
              <td width="145" align="right" nowrap bgcolor="#F4FBFF">文件路径:</td>
              <td width="1040" bgcolor="#F4FBFF"><asp:TextBox CssClass="input" ID="txtFilepath" 
                      runat="server" Width="266px"></asp:TextBox>
               </td>
            </tr>

            <tr id="ad2">
              <td width="145" align="right" nowrap bgcolor="#F4FBFF">链接地址:</td>
              <td width="1040" bgcolor="#F4FBFF"><asp:TextBox CssClass="input" ID="txtTargetUrl" 
                      runat="server" Width="266px"></asp:TextBox>
               </td>
            </tr>

            <tr id="ad3">
              <td width="145" align="right" nowrap bgcolor="#F4FBFF">投放时间:</td>
              <td width="1040" bgcolor="#F4FBFF">
                <asp:TextBox CssClass="input required dateISO" ID="txtStarttime"  runat="server" Width="120px" onclick="return Calendar('txtStarttime');"></asp:TextBox><b>-</b>
                <asp:TextBox CssClass="input required dateISO" ID="txtEndtime"  runat="server" Width="120px" onclick="return Calendar('txtEndtime');"></asp:TextBox>
                <br /><span style="color:#ffaa25; ">(左边为开始时间，右边为结束时间)</span>
               </td>
            </tr>

            <tr id="ad4">
              <td width="145" align="right" nowrap bgcolor="#F4FBFF">标签ID:</td>
              <td width="1040" bgcolor="#F4FBFF">
                 <asp:TextBox CssClass="input" ID="txtTargetid" runat="server" Width="80px"></asp:TextBox>
                 宽度<asp:TextBox CssClass="input" ID="txtWidth" Text="0" runat="server" Width="50px"></asp:TextBox>
                 高度<asp:TextBox CssClass="input" ID="txtHeight" Text="0" runat="server" Width="50px"></asp:TextBox>
                 <br /><span style="color:#ffaa25; ">(宽度、高度为0表示不设置，标签ID必选项)</span>
                  <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                      ControlToValidate="txtTargetid" ErrorMessage="<span style='color:#ff0000;'>请填写标签ID</span>" Display="Dynamic"></asp:RequiredFieldValidator>
               </td>
            </tr>

            <tr id="ad5" style="display:none;">
              <td align="right" nowrap bgcolor="#F4FBFF">代码内容:</td>
              <td bgcolor="#F4FBFF">
                    <asp:TextBox ID="txtCodestr" runat="server" CssClass="input" TextMode="MultiLine" Width="80%" Height="120px"></asp:TextBox>
                    <br /><span style="color:#ffaa25; ">(可任意编辑代码)</span>
              </td>
            </tr>

            <tr>
              <td  align="right" nowrap bgcolor="#F4FBFF">排序数字:</td>
              <td  bgcolor="#F4FBFF">
                    <asp:TextBox CssClass="input" ID="txtOrder" runat="server" Width="86px" Text="0"></asp:TextBox>
                    <br /><span style="color:#ffaa25; ">(数字越低越往后排)</span>
               </td>
            </tr>

            <tr>
              <td align="right" nowrap bgcolor="#F4FBFF">广告状态:</td>
              <td bgcolor="#F4FBFF">
                    <asp:CheckBox ID="cbxDisabled" Text="禁用广告" runat="server" />
              </td>
            </tr>

            <tr>
              <td bgcolor="#F4FBFF">&nbsp;</td>
              <td bgcolor="#F4FBFF">
                <asp:HiddenField ID="hidReferrer" runat="server" />
                <asp:Button BackColor="#F4FBFF" CssClass="bt" ID="btnModify" 
                      runat="server" Text=" 确定 " onclick="btnModify_Click" /></td>
            </tr>
          </table>

</div>
<span class="frmbar" style="margin:0 11px;"></span><span class="frmbar" style="margin:0 12px;"></span>
</form>
</div>

<script src="../js/calendar.js" type="text/javascript"></script>
</body>
</html>
